﻿using System;

namespace Smart.Hotfix
{
	public interface ILateUpdateSystem : ISystem
	{

	}

    public interface ILateUpdate
    {
        void Run(object o);
    }

    public interface IComponentLateUpdate
    {
        void LateUpdate();
    }

    public class LateUpdateSystem<T> : ILateUpdate, ILateUpdateSystem where T : IComponentLateUpdate
    {
        public void Run(object o)
        {
            if (o is IComponentLateUpdate component)
            {
                component.LateUpdate();
            }
        }

        public Type Type()
        {
            return typeof(T);
        }
    }
}
